package uml.behavioral.responsibility_chain;

/**
 * 职责链--抽象处理者<br>
 * on 2023/1/1 1:30
 */
public class Director extends Approver{
    public Director(String name) {
        super(name);
        this.job="部门主管";
    }

    @Override
    public void dealWith(PurchaseRequest request) {
        if (request.getAmount()<5){
            this.agree(request);
        }else {
            this.nextApprover.dealWith(request);
        }
    }
}
